﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Accessing_Data {
    /// <summary>
    /// Lógica de interacción para MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e) {

            Accessing_Data.NwindDataSet nwindDataSet = ((Accessing_Data.NwindDataSet)(this.FindResource("nwindDataSet")));
            // Cargar datos en la tabla Customers. Puede modificar este código según sea necesario.
            Accessing_Data.NwindDataSetTableAdapters.CustomersTableAdapter nwindDataSetCustomersTableAdapter = new Accessing_Data.NwindDataSetTableAdapters.CustomersTableAdapter();
            nwindDataSetCustomersTableAdapter.Fill(nwindDataSet.Customers);
            System.Windows.Data.CollectionViewSource customersViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("customersViewSource")));
            customersViewSource.View.MoveCurrentToFirst();
            // Cargar datos en la tabla Orders. Puede modificar este código según sea necesario.
            Accessing_Data.NwindDataSetTableAdapters.OrdersTableAdapter nwindDataSetOrdersTableAdapter = new Accessing_Data.NwindDataSetTableAdapters.OrdersTableAdapter();
            nwindDataSetOrdersTableAdapter.Fill(nwindDataSet.Orders);
            System.Windows.Data.CollectionViewSource ordersViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ordersViewSource")));
            ordersViewSource.View.MoveCurrentToFirst();
            // Cargar datos en la tabla Order_Details_Extended. Puede modificar este código según sea necesario.
            Accessing_Data.NwindDataSetTableAdapters.Order_Details_ExtendedTableAdapter nwindDataSetOrder_Details_ExtendedTableAdapter = new Accessing_Data.NwindDataSetTableAdapters.Order_Details_ExtendedTableAdapter();
            nwindDataSetOrder_Details_ExtendedTableAdapter.Fill(nwindDataSet.Order_Details_Extended);
            System.Windows.Data.CollectionViewSource order_Details_ExtendedViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("order_Details_ExtendedViewSource")));
            order_Details_ExtendedViewSource.View.MoveCurrentToFirst();
        }
    }
}
